home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / QNX4_FS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  4KB  |  124 lines

  1. /*
  2.  *  Name                         : qnx4_fs.h
  3.  *  Author                       : Richard Frowijn
  4.  *  Function                     : qnx4 global filesystem definitions
  5.  *  Version                      : 1.0
  6.  *  Last modified                : 23-03-1998
  7.  *
  8.  *  History                      : 23-03-1998 created
  9.  */
  10. #ifndef _LINUX_QNX4_FS_H
  11. #define _LINUX_QNX4_FS_H
  12.  
  13. #include <linux/qnxtypes.h>
  14.  
  15. #define QNX4_ROOT_INO 1
  16.  
  17. #define _MAX_XTNTS_PER_XBLK    60
  18. /* for di_status */
  19. #define QNX4_FILE_USED          0x01
  20. #define QNX4_FILE_MODIFIED      0x02
  21. #define QNX4_FILE_BUSY          0x04
  22. #define QNX4_FILE_LINK          0x08
  23. #define QNX4_FILE_INODE         0x10
  24. #define QNX4_FILE_FSYSCLEAN     0x20
  25.  
  26. #define QNX4_I_MAP_SLOTS    8
  27. #define QNX4_Z_MAP_SLOTS    64
  28. #define QNX4_SUPER_MAGIC    0x002f    /* qnx4 fs detection */
  29. #define QNX4_VALID_FS        0x0001    /* Clean fs. */
  30. #define QNX4_ERROR_FS        0x0002    /* fs has errors. */
  31. #define QNX4_BLOCK_SIZE         0x200    /* blocksize of 512 bytes */
  32. #define QNX4_DIR_ENTRY_SIZE     0x040    /* dir entry size */
  33. #define QNX4_XBLK_ENTRY_SIZE    0x200    /* xblk entry size */
  34. #define QNX4_INODES_PER_BLOCK   0x08    /* 512 / 64 */
  35.  
  36. /* for filenames */
  37. #define _SHORT_NAME_MAX        16
  38. #define QNX4_NAME_MAX          48
  39.  
  40. /*
  41.  * This is the original qnx4 inode layout on disk.
  42.  */
  43. struct qnx4_inode_entry {
  44.     char di_fname[16];
  45.     off_t di_size;
  46.     _xtnt_t di_first_xtnt;
  47.     long di_xblk;
  48.     time_t di_ftime;
  49.     time_t di_mtime;
  50.     time_t di_atime;
  51.     time_t di_ctime;
  52.     _nxtnt_t di_num_xtnts;
  53.     mode_t di_mode;
  54.     muid_t di_uid;
  55.     mgid_t di_gid;
  56.     nlink_t di_nlink;
  57.     char di_zero[4];
  58.     _ftype_t di_type;
  59.     unsigned char di_status;
  60. };
  61.  
  62. struct qnx4_link_info {
  63.     char dl_fname[QNX4_NAME_MAX];
  64.     long dl_inode_blk;
  65.     unsigned char dl_inode_ndx;
  66.     unsigned char dl_spare[10];
  67.     unsigned char dl_status;
  68. };
  69.  
  70. struct qnx4_xblk {
  71.     long xblk_next_xblk;
  72.     long xblk_prev_xblk;
  73.     unsigned char xblk_num_xtnts;
  74.     char xblk_spare[3];
  75.     long xblk_num_blocks;
  76.     _xtnt_t xblk_xnts[_MAX_XTNTS_PER_XBLK];
  77.     char xblk_signature[8];
  78.     _xtnt_t xblk_first_xtnt;
  79. };
  80.  
  81. struct qnx4_super_block {
  82.     struct qnx4_inode_entry RootDir;
  83.     struct qnx4_inode_entry Inode;
  84.     struct qnx4_inode_entry Boot;
  85.     struct qnx4_inode_entry AltBoot;
  86. };
  87.  
  88. #ifdef __KERNEL__
  89.  
  90. #define QNX4_DEBUG 0
  91.  
  92. #if QNX4_DEBUG
  93. #define QNX4DEBUG(X) printk X
  94. #else
  95. #define QNX4DEBUG(X) (void) 0
  96. #endif
  97.  
  98. extern int qnx4_lookup(struct inode *dir, struct dentry *dentry);
  99. extern unsigned long qnx4_count_free_inodes(struct super_block *sb);
  100. extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
  101.  
  102. extern struct buffer_head *qnx4_getblk(struct inode *, int, int);
  103. extern struct buffer_head *qnx4_bread(struct inode *, int, int);
  104.  
  105. extern int init_qnx4_fs(void);
  106. extern int qnx4_create(struct inode *dir, struct dentry *dentry, int mode);
  107. extern struct inode_operations qnx4_file_inode_operations;
  108. extern struct inode_operations qnx4_dir_inode_operations;
  109. extern struct inode_operations qnx4_symlink_inode_operations;
  110. extern int qnx4_is_free(struct super_block *sb, int block);
  111. extern int qnx4_set_bitmap(struct super_block *sb, int block, int busy);
  112. extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode);
  113. extern void qnx4_truncate(struct inode *inode);
  114. extern void qnx4_free_inode(struct inode *inode);
  115. extern int qnx4_unlink(struct inode *dir, struct dentry *dentry);
  116. extern int qnx4_rmdir(struct inode *dir, struct dentry *dentry);
  117. extern int qnx4_sync_file(struct file *file, struct dentry *dentry);
  118. extern int qnx4_sync_inode(struct inode *inode);
  119. extern int qnx4_bmap(struct inode *inode, int block);
  120.  
  121. #endif                /* __KERNEL__ */
  122.  
  123. #endif
  124.